package com.bookbuf.cardflipanimation;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by robert on 16/7/6.
 */
public class CardBackFragment extends Fragment {

	public static CardBackFragment newInstance () {

		Bundle args = new Bundle ();

		CardBackFragment fragment = new CardBackFragment ();
		fragment.setArguments (args);
		return fragment;
	}

	@Override
	public View onCreateView (LayoutInflater inflater, ViewGroup container,
							  Bundle savedInstanceState) {
		return inflater.inflate (R.layout.fragment_back, container, false);
	}

	@Override
	public void onViewCreated (View view, Bundle savedInstanceState) {
		super.onViewCreated (view, savedInstanceState);
		view.setOnClickListener (new View.OnClickListener () {
			@Override
			public void onClick (View v) {
				getFragmentManager ().popBackStack ();
			}
		});
	}
}
